import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/application/maintain_logs_request_entity.dart';

MaintainLogsRequestEntity $MaintainLogsRequestEntityFromJson(Map<String, dynamic> json) {
  final MaintainLogsRequestEntity maintainLogsRequestEntity = MaintainLogsRequestEntity();
  final int? deviceId = jsonConvert.convert<int>(json['deviceId']);
  if (deviceId != null) {
    maintainLogsRequestEntity.deviceId = deviceId;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    maintainLogsRequestEntity.id = id;
  }
  final String? maintenanceRecords = jsonConvert.convert<String>(json['maintenanceRecords']);
  if (maintenanceRecords != null) {
    maintainLogsRequestEntity.maintenanceRecords = maintenanceRecords;
  }
  final String? operators = jsonConvert.convert<String>(json['operators']);
  if (operators != null) {
    maintainLogsRequestEntity.operators = operators;
  }
  final String? operationTime = jsonConvert.convert<String>(json['operationTime']);
  if (operationTime != null) {
    maintainLogsRequestEntity.operationTime = operationTime;
  }
  return maintainLogsRequestEntity;
}

Map<String, dynamic> $MaintainLogsRequestEntityToJson(MaintainLogsRequestEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['deviceId'] = entity.deviceId;
  data['id'] = entity.id;
  data['maintenanceRecords'] = entity.maintenanceRecords;
  data['operators'] = entity.operators;
  data['operationTime'] = entity.operationTime;
  return data;
}

extension MaintainLogsRequestEntityExtension on MaintainLogsRequestEntity {
  MaintainLogsRequestEntity copyWith({
    int? deviceId,
    int? id,
    String? maintenanceRecords,
    String? operators,
    String? operationTime,
  }) {
    return MaintainLogsRequestEntity()
      ..deviceId = deviceId ?? this.deviceId
      ..id = id ?? this.id
      ..maintenanceRecords = maintenanceRecords ?? this.maintenanceRecords
      ..operators = operators ?? this.operators
      ..operationTime = operationTime ?? this.operationTime;
  }
}